//两个有序数组合并后的第K大个数 两个有序数组合并后的第K大个数   //可能存在重复的数字
int maxK(vector<int>& v1, vector<int>& v2, int k)
{
    int size1 = v1.size();
    int size2 = v2.size();
    vector<int> v(size1 + size2);
    int cur1 = 0, cur2 = 0;
    int cur = 0;
    while (cur1 < size1 || cur2 < size2) {
        if (cur1 < size1 && cur2 < size2) {
            if (v1[cur1] <= v2[cur2]) {
                v[cur++] = v1[cur1++];
            }
            else {
                v[cur++] = v2[cur2++];
            }
        }
        else if (cur1 < size1) {
            v[cur++] = v1[cur1++];
        }
        else if(cur2 < size2) {
            v[cur++] = v2[cur2++];
        }
    }
    int flag = 0;
    cur = v.size() - 1;
    while (cur >= 0 && flag < k) {
        int tmp = v[cur];
        while (cur >= 0 && v[cur] == tmp) {
            --cur;
        }
        ++flag;
        if (flag == k) {
            return tmp;
        }
    }
    return -1; //没有第K大的数
}